package biz.inspeed.test.windows;

import java.awt.Font;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.TimeUnit;

import javax.swing.JFrame;
import javax.swing.JTextArea;

public class TimerWindow {

//	public static MyWindow window = new MyWindow("Hello,World");
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		Timer t = new Timer(false);
		t.schedule(new ShowTask(), 0, TimeUnit.MILLISECONDS.convert(15, TimeUnit.MINUTES));
	}

}
class ShowTask extends TimerTask{
	@Override
	public void run() {
//		TimerWindow.window.setVisible(true);
		new MyWindow("Hello,World");
	}
}

class MyWindow extends JFrame {
	private static JTextArea mTextArea = new JTextArea("大多数人想要改造这个世界，\n但却罕有人想改造自己");
	public MyWindow(String title) {
		super(title);
		setSize(500, 500);
		setLocation(30, 50);
		setVisible(true);
		mTextArea.setFont(new Font("宋体",Font.PLAIN,28));
		add(mTextArea);
		setAlwaysOnTop(true);
//		setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
		
	}

}
